<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/tcpbase.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">tcpbase.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d16/tcpbase_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#ifndef __UV_TCP_CLIENT_HPP__</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#define __UV_TCP_CLIENT_HPP__</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &lt;uv.h&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#include &lt;atomic&gt;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#include &quot;<a class="code" href="../../d0/d0e/misc_8hpp.html">misc.hpp</a>&quot;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#include &quot;<a class="code" href="../../dc/d4b/uvlper_8hpp.html">uvlper.hpp</a>&quot;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#include &quot;<a class="code" href="../../df/d05/timer_8hpp.html">timer.hpp</a>&quot;</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span> </div>
<div class="foldopen" id="foldopen00021" data-start="{" data-end="};">
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html">   21</a></span><span class="keyword">class </span><a class="code hl_class" href="../../db/d6e/class_c_u_v_client.html">CUVClient</a></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>{</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00026" data-start="{" data-end="};">
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">   26</a></span>    <span class="keyword">enum</span> <a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">err_code</a> {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58ae3c9bbdab909aa76e8083f25588d4144">   27</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58ae3c9bbdab909aa76e8083f25588d4144">ERR_UVCLIENT_INIT_MUTEX</a> = -1000,</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58aae261adeeb1d5836a7321560f1766f85">   28</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58aae261adeeb1d5836a7321560f1766f85">ERR_UVCLIENT_LOOP_CONFIG</a> ,</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a4e5c95eaec1e996494fc22087b14978a">   29</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a4e5c95eaec1e996494fc22087b14978a">ERR_UVCLIENT_LOOP_INIT</a>,</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a0b461e4c214c215937c371a01dbbbfca">   30</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a0b461e4c214c215937c371a01dbbbfca">ERR_UVCLIENT_INIT_TCP</a>,</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58abc96c2538ddf34e03726ff069564d8d0">   31</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58abc96c2538ddf34e03726ff069564d8d0">ERR_UVCLIENT_OPERATION</a>,</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a9c10b23ae91200ca36f1c55d783964e0">   32</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a9c10b23ae91200ca36f1c55d783964e0">ERR_UVCLIENT_ALOCMEM</a>,</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a66b0863905fd767a2e2b42030c18bec4">   33</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a66b0863905fd767a2e2b42030c18bec4">ERR_UVCLIENT_CONNECTION</a>,</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58aab6af6e1ea09e5e79f7448e05f105d80">   34</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58aab6af6e1ea09e5e79f7448e05f105d80">ERR_UV_DNS_RESOLVE</a>,</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a6d5ea39f90cf0cbd5ae24108811c7f0c">   35</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a6d5ea39f90cf0cbd5ae24108811c7f0c">ERR_ALLOC_MEM</a>,</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58aa21929f4e89447ed2568f55661fe80bc">   36</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58aa21929f4e89447ed2568f55661fe80bc">ERR_UVCLIENT_RECV</a>,</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a52c863e5726058cfb624aacb54a42762">   37</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a52c863e5726058cfb624aacb54a42762">ERR_UVCLIENT_SEND</a>,</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a503b1dc10bfb0898c95cb23bc936f116">   38</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a503b1dc10bfb0898c95cb23bc936f116">ERR_UVCLIENT_DNS</a>,</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a6bf07154c0b4ba6a5849a835738dd896">   39</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a6bf07154c0b4ba6a5849a835738dd896">UV_CLIENT_CREATE_THD</a>,</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a13f2b6bc173e934bfb3039bb3454dba3">   40</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a13f2b6bc173e934bfb3039bb3454dba3">ERR_CONN_OVERTIME</a>,</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a1337d5e97c2217e467a29453df059d90">   41</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a1337d5e97c2217e467a29453df059d90">ERR_SEND_DATA_EMPTY</a>,</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a39ecc66b86ca7356cb023868919b086b">   42</a></span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a39ecc66b86ca7356cb023868919b086b">ERR_DATA_NULL</a>,</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>        <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a147327933a6559522b3d469d74212d87">OK</a> = 0</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a147327933a6559522b3d469d74212d87">   44</a></span>        };</div>
</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a85f7389ef98f94406cfab70191465afe">   45</a></span>    <span class="keyword">using </span><a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">emErrCode</a> = <a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">err_code</a>;</div>
<div class="foldopen" id="foldopen00052" data-start="{" data-end="};">
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html">   52</a></span>    <span class="keyword">struct </span><a class="code hl_struct" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html">st_wd</a>{</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#ade7900bf50dee295500572345477f46c">   53</a></span>        <span class="keywordtype">void</span> *<a class="code hl_variable" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#ade7900bf50dee295500572345477f46c">__buff</a>;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#a60d408729eb32b45c3d5f2c2a15d1d5a">   54</a></span>        <span class="keywordtype">void</span> *<a class="code hl_variable" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#a60d408729eb32b45c3d5f2c2a15d1d5a">__this</a>;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#ad74930fea69b2edc0e8c0ada48a4916f">   55</a></span>        <span class="keywordtype">size_t</span>  <a class="code hl_variable" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#ad74930fea69b2edc0e8c0ada48a4916f">__ds</a>;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#a7a5e67a6be418374f942ffb79f405d14">   57</a></span>        <a class="code hl_function" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#a7a5e67a6be418374f942ffb79f405d14">st_wd</a>():<a class="code hl_variable" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#ade7900bf50dee295500572345477f46c">__buff</a>( nullptr ), <a class="code hl_variable" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#a60d408729eb32b45c3d5f2c2a15d1d5a">__this</a>( nullptr ), <a class="code hl_variable" href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#ad74930fea69b2edc0e8c0ada48a4916f">__ds</a>( 0 ){}</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>    };</div>
</div>
<div class="foldopen" id="foldopen00062" data-start="{" data-end="};">
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="../../dc/dba/struct_c_u_v_client_1_1st__connreq.html">   62</a></span>    <span class="keyword">struct </span><a class="code hl_struct" href="../../dc/dba/struct_c_u_v_client_1_1st__connreq.html">st_connreq</a>{</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="../../dc/dba/struct_c_u_v_client_1_1st__connreq.html#a29f4498a2ff0ecc6048259bcfbbcdcb2">   63</a></span>        <a class="code hl_class" href="../../db/d6e/class_c_u_v_client.html">CUVClient</a>  * <a class="code hl_variable" href="../../dc/dba/struct_c_u_v_client_1_1st__connreq.html#a29f4498a2ff0ecc6048259bcfbbcdcb2">obj</a>;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="../../dc/dba/struct_c_u_v_client_1_1st__connreq.html#a09676d49bdc1ccb713830c70704e3af5">   65</a></span>        <a class="code hl_function" href="../../dc/dba/struct_c_u_v_client_1_1st__connreq.html#a09676d49bdc1ccb713830c70704e3af5">st_connreq</a>():<a class="code hl_variable" href="../../dc/dba/struct_c_u_v_client_1_1st__connreq.html#a29f4498a2ff0ecc6048259bcfbbcdcb2">obj</a>( nullptr ){}</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>    };</div>
</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ae74d74bc2a71385ecf47b7c0cb783610">   68</a></span>    uv_connect_t          <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#ae74d74bc2a71385ecf47b7c0cb783610">req</a>;                <span class="comment">//连接请求句柄</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a7caf0a98983c48c28eed874dfa0d20cd">   69</a></span>    uv_getaddrinfo_t      <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a7caf0a98983c48c28eed874dfa0d20cd">dns</a>;                <span class="comment">//dns解析返回值</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a9d5b60e39b3968c4876692fa0d3bab38">   71</a></span>    <span class="keywordtype">bool</span>                  <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a9d5b60e39b3968c4876692fa0d3bab38">m_dns_flag</a>;         <span class="comment">//dns解析是否完成</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a41faa71c0389b91d20414aec3a0cdf78">   72</a></span>    std::atomic&lt;bool&gt;     <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a41faa71c0389b91d20414aec3a0cdf78">m_conn_flag</a>;        <span class="comment">//连接操作是否完成</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a288fed6612ea3141ecc2237568bf9fd7">   73</a></span>    uv_mutex_t            <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a288fed6612ea3141ecc2237568bf9fd7">m_mutex</a>;            <span class="comment">//缓冲操作互斥对象</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>    <span class="comment">//uv_buf_t              m_o_buf;            //输出缓冲</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a60f2b108d764222bfcc50cbfdc535c63">   75</a></span>    uv_buf_t              <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a60f2b108d764222bfcc50cbfdc535c63">m_i_buf</a>;            <span class="comment">//输入缓冲</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a3342be4373da4e398853a23f95fbd9f9">   76</a></span>    uv_tcp_t            * <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a3342be4373da4e398853a23f95fbd9f9">p_client</a>;           <span class="comment">//客户端TCP连接句柄</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a736629eeb5706e5faf32d26b0894ad78">   77</a></span>    std::atomic&lt;bool&gt;     <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a736629eeb5706e5faf32d26b0894ad78">is_connected</a>;       <span class="comment">// 是否链接标志</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#aa8f31023e50ff317e9746c4af2442b5c">   78</a></span>    std::atomic&lt;bool&gt;     <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#aa8f31023e50ff317e9746c4af2442b5c">is_run</a>;             <span class="comment">// 是否正在运行</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ac22db94140177279708314568830256e">   80</a></span>    std::function&lt; void ( <span class="keywordtype">size_t</span> , <span class="keyword">const</span> <span class="keywordtype">char</span> * )&gt;    <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#ac22db94140177279708314568830256e">cb_recv</a>;      <span class="comment">// 接收到数据后的回调函数</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#aaac4ecbd575496ad48ba3953cfe422c7">   81</a></span>    std::function&lt; void ( <span class="keywordtype">size_t</span> )&gt;                   <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#aaac4ecbd575496ad48ba3953cfe422c7">cb_send</a>;      <span class="comment">// 发送数据后的回调函数</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#aeb8e88fe696e6bf387c52db105e5718c">   82</a></span>    std::function&lt; void ()&gt;                           <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#aeb8e88fe696e6bf387c52db105e5718c">cb_close</a>;     <span class="comment">// 通道关闭后的回调函数</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#aabfa4218e748e659129616623b14a46d">   83</a></span>    std::function&lt; void ()&gt;                           <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#aabfa4218e748e659129616623b14a46d">cb_conn</a>;      <span class="comment">// 连接后的回调函数</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#aade49f6b18bb580dacd6945ac074a16d">   84</a></span>    std::function&lt; void( <span class="keyword">const</span> <span class="keyword">struct</span> addrinfo* cb )&gt; <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#aade49f6b18bb580dacd6945ac074a16d">cb_resolv</a>;    <span class="comment">// 域名解析后的回调函数</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a9d1d11c3b8b58c9e748ad8d40a23cb2c">   85</a></span>    std::function&lt; void( <a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">err_code</a> )&gt;                  <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a9d1d11c3b8b58c9e748ad8d40a23cb2c">cb_error</a>;     <span class="comment">// 发送后的回调函数</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>    uv_thread_t               threadhanlde;                <span class="comment">// libuv 线程句柄</span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>    <a class="code hl_class" href="../../db/d3e/classwheels_1_1_c_timer.html">wheels::CTimer</a>            m_conn_overtime;             <span class="comment">// 连接超时计时器</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>    std::atomic&lt;int&gt;          m_port;                      <span class="comment">// 服务器端口</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>    std::string               m_remote;                    <span class="comment">// 远程地址，可以是url或者IP地址，支持IP6和IP4</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span> </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>    std::atomic&lt;err_code&gt;     m_error;                     <span class="comment">// 错误代码</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>    std::string               err_msg;                     <span class="comment">// 错误信息</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>    std::atomic&lt; bool &gt;       m_is_closed;                 <span class="comment">// 通道是否开启</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>        <span class="keywordtype">bool</span>                      m_closed_on_error;           <span class="comment">// </span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>    <span class="keyword">struct </span>addrinfo         * p_resolve_rst;               <span class="comment">// DNS解析后的结果</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>    <span class="keyword">struct </span>addrinfo         * p_conn_current;              <span class="comment">// 当前尝试连接的地址</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>    <span class="keywordtype">void</span> connect4( );</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span>    <span class="keywordtype">void</span> connect6( );</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span>    <span class="keywordtype">void</span> connecturl( );</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>    <a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">err_code</a> real_connect( <span class="keyword">struct</span> sockaddr* add );</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span>    <span class="keywordtype">void</span> init();</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>    <span class="keywordtype">void</span> stop();</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span>    <span class="keywordtype">void</span> save_dns_result( <span class="keyword">struct</span> addrinfo *rest );</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>    <span class="keywordtype">void</span> init_dns_result();</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>    <span class="keywordtype">void</span> free_dns_result();</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span>    <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#aa775314ab893e731e2dbb56cfdc605b9">CUVClient</a>( <span class="keyword">const</span> std::string&amp; url , <span class="keywordtype">int</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a59c6686860298236ab1e539f961ba525">port</a> );</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span>    <span class="keyword">virtual</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a76b2bfaf67b5633d2674516bf42f02b6">~CUVClient</a>(  );</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a47ca5c1b3508b746a71f69ef87a04041">connect</a>();</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a47ca5c1b3508b746a71f69ef87a04041">connect</a>( <span class="keyword">const</span> std::string&amp; url , <span class="keywordtype">int</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a59c6686860298236ab1e539f961ba525">port</a> );</div>
<div class="foldopen" id="foldopen00158" data-start="{" data-end="}">
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#ae40a32721569cbe4465dcbc89d028262">  158</a></span>    <span class="keyword">operator</span> bool()</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span>    {</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>        <span class="keywordflow">return</span> <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a736629eeb5706e5faf32d26b0894ad78">is_connected</a>.load();</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>    }</div>
</div>
<div class="foldopen" id="foldopen00162" data-start="{" data-end="}">
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a0b21869bfc5cdf67971cf4d3100efc6f">  162</a></span>    <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a0b21869bfc5cdf67971cf4d3100efc6f">isConnected</a>()</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span>    {</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span>        <span class="keywordflow">return</span> <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a736629eeb5706e5faf32d26b0894ad78">is_connected</a>.load();</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span>    }</div>
</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>    <a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">err_code</a> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a9fa40f908f40bc2fc0638ebce51cd220">Send</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* data , <span class="keywordtype">size_t</span> s );</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a4429b8b21e1c6edf3780ac96dadb107a">OnSend</a>( <span class="keywordtype">size_t</span> s , <a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">err_code</a> e  );</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#abafcf34dfd18e780b6d9ae69347993d7">  186</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#abafcf34dfd18e780b6d9ae69347993d7">OnRecv</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="comment">/*buff*/</span> , <span class="keywordtype">size_t</span> <span class="comment">/*s */</span>, <a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">err_code</a> ){}</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#aebd24a8632f21e89f7bdb2946c5c1d3e">Close</a>();</div>
<div class="foldopen" id="foldopen00194" data-start="{" data-end="}">
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#af76e08cee2ed876b1274a1dd04817da6">  194</a></span>    uv_tcp_t* <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#af76e08cee2ed876b1274a1dd04817da6">Client</a>(  )</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>    {</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span>        <span class="keywordflow">return</span> <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a3342be4373da4e398853a23f95fbd9f9">p_client</a>;</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span>    }</div>
</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span> </div>
<div class="foldopen" id="foldopen00199" data-start="{" data-end="}">
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a802a4b3d13020fd40e1ef5a753b46e3f">  199</a></span>    <span class="keyword">inline</span> <span class="keyword">const</span> std::string&amp; <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a802a4b3d13020fd40e1ef5a753b46e3f">GetURL</a>(  )<span class="keyword">const</span></div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno">  200</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno">  201</span>        <span class="keywordflow">return</span> m_remote;</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno">  202</span>    }</div>
</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span> </div>
<div class="foldopen" id="foldopen00204" data-start="{" data-end="}">
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a9e531662e5c09c616bb50b797f49ac22">  204</a></span>    <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a9e531662e5c09c616bb50b797f49ac22">GetPort</a>(  )</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span>    {</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span>        <span class="keywordflow">return</span> m_port;</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span>    }</div>
</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a898b996860b0e38d8f83f5bca9afbde1">  212</a></span>    <span class="keyword">const</span> std::string&amp; <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a898b996860b0e38d8f83f5bca9afbde1">server</a>( )<span class="keyword">const</span>{ <span class="keywordflow">return</span> m_remote; }</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a49f749be17943d78a3472807254b05fb">  216</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a49f749be17943d78a3472807254b05fb">server</a>( <span class="keyword">const</span> std::string&amp; svr ) { m_remote = svr; }</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a59c6686860298236ab1e539f961ba525">  220</a></span>    <span class="keywordtype">int</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a59c6686860298236ab1e539f961ba525">port</a>(){ <span class="keywordflow">return</span> m_port; }</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#aecd5a533b5960854bb67535986b24e8c">  224</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#aecd5a533b5960854bb67535986b24e8c">port</a>( <span class="keywordtype">int</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a59c6686860298236ab1e539f961ba525">port</a> ){ m_port = <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#aecd5a533b5960854bb67535986b24e8c">port</a>; }</div>
<div class="foldopen" id="foldopen00228" data-start="{" data-end="}">
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a9f7a91e9651658b801d1955b88ccb957">  228</a></span>    <a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">err_code</a> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a9f7a91e9651658b801d1955b88ccb957">Error</a>()</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span>    {</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>        <span class="keywordflow">return</span> m_error;</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span>    }</div>
</div>
<div class="foldopen" id="foldopen00236" data-start="{" data-end="}">
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#aa31faff813bc6892717e4a6397f518d9">  236</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#aa31faff813bc6892717e4a6397f518d9">Error</a>( <span class="keywordtype">int</span> e )</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span>    {</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span>        <span class="keywordflow">if</span>( e ){</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno">  239</span>            m_error = <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58abc96c2538ddf34e03726ff069564d8d0">ERR_UVCLIENT_OPERATION</a>;</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno">  240</span>            err_msg = uv_strerror( e );</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span>        }<span class="keywordflow">else</span>{</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno">  242</span>            m_error = <a class="code hl_enumvalue" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a147327933a6559522b3d469d74212d87">OK</a>;</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno">  243</span>            err_msg = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno">  244</span>        }</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno">  245</span>    }</div>
</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno">  246</span>    <span class="keyword">static</span> std::string <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a221ba3c964e7dd09d09c9c180a3c2557">errMsg</a>( <span class="keywordtype">int</span> e );</div>
<div class="foldopen" id="foldopen00250" data-start="{" data-end="}">
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a55fa1b5387858f986b051e2abaa358d6">  250</a></span>    std::string <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a55fa1b5387858f986b051e2abaa358d6">ErrMsg</a>()</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span>    {</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span>        <span class="keywordflow">return</span> err_msg;</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span>    }</div>
</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a85c74bb0d72542e0a710ac1f10e2640b">onError</a>( <span class="keywordtype">int</span> error );</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno">  262</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#ad88a2b7043d30c8cc6bd6541a9bae8f4">onShutdown</a>();</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno">  266</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a2f13c67e75922215b8e289de86ab3ad2">OnClose</a>();</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a7367ec0e036e66075311573371038516">OnConnected</a>( <a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">err_code</a> e );</div>
<div class="foldopen" id="foldopen00276" data-start="{" data-end="}">
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a5e281fb0756bff921349e621177426f5">  276</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a5e281fb0756bff921349e621177426f5">on_open</a>( std::function&lt; <span class="keywordtype">void</span>()&gt; fun )</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span>    {</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno">  278</span>        <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#aabfa4218e748e659129616623b14a46d">cb_conn</a> = fun;</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno">  279</span>    }</div>
</div>
<div class="foldopen" id="foldopen00285" data-start="{" data-end="}">
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#abb0bccfc4b75000932f6f02f35a7e8fe">  285</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#abb0bccfc4b75000932f6f02f35a7e8fe">on_close</a>( std::function&lt;<span class="keywordtype">void</span>()&gt; f )</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno">  286</span>    {</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno">  287</span>        <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#aeb8e88fe696e6bf387c52db105e5718c">cb_close</a> = f;</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno">  288</span>    }</div>
</div>
<div class="foldopen" id="foldopen00294" data-start="{" data-end="}">
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a8af8d7fc6f975a4f3e22ce3eb5720790">  294</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a8af8d7fc6f975a4f3e22ce3eb5720790">on_data</a>( std::function&lt; <span class="keywordtype">void</span> (<span class="keywordtype">size_t</span> , <span class="keyword">const</span> <span class="keywordtype">char</span> *  ) &gt; fun )</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno">  295</span>    {</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno">  296</span>        <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#ac22db94140177279708314568830256e">cb_recv</a> = fun;</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno">  297</span>    }</div>
</div>
<div class="foldopen" id="foldopen00303" data-start="{" data-end="}">
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#a5ea36bb84f8660466ffd83024bb0f400">  303</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#a5ea36bb84f8660466ffd83024bb0f400">on_error</a>( std::function&lt; <span class="keywordtype">void</span> (<a class="code hl_enumeration" href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">CUVClient::err_code</a>) &gt; f )</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno">  304</span>    {</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno">  305</span>        <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#a9d1d11c3b8b58c9e748ad8d40a23cb2c">cb_error</a> = f;</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno">  306</span>    }</div>
</div>
<div class="foldopen" id="foldopen00312" data-start="{" data-end="}">
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"><a class="line" href="../../db/d6e/class_c_u_v_client.html#abf27a8321a7a8b94267cdbb08e8c8f5d">  312</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d6e/class_c_u_v_client.html#abf27a8321a7a8b94267cdbb08e8c8f5d">on_send</a>( std::function&lt; <span class="keywordtype">void</span> (<span class="keywordtype">size_t</span> )&gt; f )</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno">  313</span>    {</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno">  314</span>        <a class="code hl_variable" href="../../db/d6e/class_c_u_v_client.html#aaac4ecbd575496ad48ba3953cfe422c7">cb_send</a> = f;</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno">  315</span>    }</div>
</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno">  316</span>};</div>
</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno">  317</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclass_c_u_v_client_html"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html">CUVClient</a></div><div class="ttdoc">使用libuv实现的客户端连接.主要面向PC端的应用开发支持，也可以将这个库移植到android和 IOS系统上完成三种应用上统一的接口。</div><div class="ttdef"><b>定义</b> <a href="#l00021">tcpbase.hpp:22</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a0b21869bfc5cdf67971cf4d3100efc6f"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a0b21869bfc5cdf67971cf4d3100efc6f">CUVClient::isConnected</a></div><div class="ttdeci">bool isConnected()</div><div class="ttdef"><b>定义</b> <a href="#l00162">tcpbase.hpp:162</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a221ba3c964e7dd09d09c9c180a3c2557"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a221ba3c964e7dd09d09c9c180a3c2557">CUVClient::errMsg</a></div><div class="ttdeci">static std::string errMsg(int e)</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00526">uv_tcp_c.cpp:526</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a288fed6612ea3141ecc2237568bf9fd7"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a288fed6612ea3141ecc2237568bf9fd7">CUVClient::m_mutex</a></div><div class="ttdeci">uv_mutex_t m_mutex</div><div class="ttdef"><b>定义</b> <a href="#l00073">tcpbase.hpp:73</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a2f13c67e75922215b8e289de86ab3ad2"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a2f13c67e75922215b8e289de86ab3ad2">CUVClient::OnClose</a></div><div class="ttdeci">void OnClose()</div><div class="ttdoc">处理通道关闭</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00215">uv_tcp_c.cpp:215</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a3342be4373da4e398853a23f95fbd9f9"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a3342be4373da4e398853a23f95fbd9f9">CUVClient::p_client</a></div><div class="ttdeci">uv_tcp_t * p_client</div><div class="ttdef"><b>定义</b> <a href="#l00076">tcpbase.hpp:76</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a41faa71c0389b91d20414aec3a0cdf78"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a41faa71c0389b91d20414aec3a0cdf78">CUVClient::m_conn_flag</a></div><div class="ttdeci">std::atomic&lt; bool &gt; m_conn_flag</div><div class="ttdef"><b>定义</b> <a href="#l00072">tcpbase.hpp:72</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a4429b8b21e1c6edf3780ac96dadb107a"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a4429b8b21e1c6edf3780ac96dadb107a">CUVClient::OnSend</a></div><div class="ttdeci">virtual void OnSend(size_t s, err_code e)</div><div class="ttdoc">完成发送后会调用这个函数</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00234">uv_tcp_c.cpp:234</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a47ca5c1b3508b746a71f69ef87a04041"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a47ca5c1b3508b746a71f69ef87a04041">CUVClient::connect</a></div><div class="ttdeci">void connect()</div><div class="ttdoc">外界操作连接口</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00453">uv_tcp_c.cpp:453</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a49f749be17943d78a3472807254b05fb"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a49f749be17943d78a3472807254b05fb">CUVClient::server</a></div><div class="ttdeci">void server(const std::string &amp;svr)</div><div class="ttdoc">指定远程服务器地址</div><div class="ttdef"><b>定义</b> <a href="#l00216">tcpbase.hpp:216</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a55fa1b5387858f986b051e2abaa358d6"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a55fa1b5387858f986b051e2abaa358d6">CUVClient::ErrMsg</a></div><div class="ttdeci">std::string ErrMsg()</div><div class="ttdoc">获取错误信息</div><div class="ttdef"><b>定义</b> <a href="#l00250">tcpbase.hpp:250</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a59c6686860298236ab1e539f961ba525"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a59c6686860298236ab1e539f961ba525">CUVClient::port</a></div><div class="ttdeci">int port()</div><div class="ttdoc">获取服务器端口</div><div class="ttdef"><b>定义</b> <a href="#l00220">tcpbase.hpp:220</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a5e281fb0756bff921349e621177426f5"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a5e281fb0756bff921349e621177426f5">CUVClient::on_open</a></div><div class="ttdeci">void on_open(std::function&lt; void()&gt; fun)</div><div class="ttdoc">设置打开事𢓐回调函数</div><div class="ttdef"><b>定义</b> <a href="#l00276">tcpbase.hpp:276</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a5ea36bb84f8660466ffd83024bb0f400"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a5ea36bb84f8660466ffd83024bb0f400">CUVClient::on_error</a></div><div class="ttdeci">void on_error(std::function&lt; void(CUVClient::err_code) &gt; f)</div><div class="ttdoc">设置错误处理回调函数</div><div class="ttdef"><b>定义</b> <a href="#l00303">tcpbase.hpp:303</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a60f2b108d764222bfcc50cbfdc535c63"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a60f2b108d764222bfcc50cbfdc535c63">CUVClient::m_i_buf</a></div><div class="ttdeci">uv_buf_t m_i_buf</div><div class="ttdef"><b>定义</b> <a href="#l00075">tcpbase.hpp:75</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a736629eeb5706e5faf32d26b0894ad78"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a736629eeb5706e5faf32d26b0894ad78">CUVClient::is_connected</a></div><div class="ttdeci">std::atomic&lt; bool &gt; is_connected</div><div class="ttdef"><b>定义</b> <a href="#l00077">tcpbase.hpp:77</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a7367ec0e036e66075311573371038516"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a7367ec0e036e66075311573371038516">CUVClient::OnConnected</a></div><div class="ttdeci">void OnConnected(err_code e)</div><div class="ttdoc">连接后调用这个函数</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00500">uv_tcp_c.cpp:500</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a76b2bfaf67b5633d2674516bf42f02b6"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a76b2bfaf67b5633d2674516bf42f02b6">CUVClient::~CUVClient</a></div><div class="ttdeci">virtual ~CUVClient()</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00132">uv_tcp_c.cpp:132</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a7caf0a98983c48c28eed874dfa0d20cd"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a7caf0a98983c48c28eed874dfa0d20cd">CUVClient::dns</a></div><div class="ttdeci">uv_getaddrinfo_t dns</div><div class="ttdef"><b>定义</b> <a href="#l00069">tcpbase.hpp:69</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a802a4b3d13020fd40e1ef5a753b46e3f"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a802a4b3d13020fd40e1ef5a753b46e3f">CUVClient::GetURL</a></div><div class="ttdeci">const std::string &amp; GetURL() const</div><div class="ttdef"><b>定义</b> <a href="#l00199">tcpbase.hpp:199</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a85c74bb0d72542e0a710ac1f10e2640b"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a85c74bb0d72542e0a710ac1f10e2640b">CUVClient::onError</a></div><div class="ttdeci">void onError(int error)</div><div class="ttdoc">处理libuv的错误</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00151">uv_tcp_c.cpp:151</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a898b996860b0e38d8f83f5bca9afbde1"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a898b996860b0e38d8f83f5bca9afbde1">CUVClient::server</a></div><div class="ttdeci">const std::string &amp; server() const</div><div class="ttdoc">获取服务端地址，可能是URL也可能是IP地址</div><div class="ttdef"><b>定义</b> <a href="#l00212">tcpbase.hpp:212</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a8af8d7fc6f975a4f3e22ce3eb5720790"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a8af8d7fc6f975a4f3e22ce3eb5720790">CUVClient::on_data</a></div><div class="ttdeci">void on_data(std::function&lt; void(size_t, const char *) &gt; fun)</div><div class="ttdoc">设置数据接收回调函数</div><div class="ttdef"><b>定义</b> <a href="#l00294">tcpbase.hpp:294</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a9d1d11c3b8b58c9e748ad8d40a23cb2c"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a9d1d11c3b8b58c9e748ad8d40a23cb2c">CUVClient::cb_error</a></div><div class="ttdeci">std::function&lt; void(err_code)&gt; cb_error</div><div class="ttdef"><b>定义</b> <a href="#l00085">tcpbase.hpp:85</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a9d5b60e39b3968c4876692fa0d3bab38"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a9d5b60e39b3968c4876692fa0d3bab38">CUVClient::m_dns_flag</a></div><div class="ttdeci">bool m_dns_flag</div><div class="ttdef"><b>定义</b> <a href="#l00071">tcpbase.hpp:71</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a9e531662e5c09c616bb50b797f49ac22"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a9e531662e5c09c616bb50b797f49ac22">CUVClient::GetPort</a></div><div class="ttdeci">int GetPort()</div><div class="ttdef"><b>定义</b> <a href="#l00204">tcpbase.hpp:204</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a9f7a91e9651658b801d1955b88ccb957"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a9f7a91e9651658b801d1955b88ccb957">CUVClient::Error</a></div><div class="ttdeci">err_code Error()</div><div class="ttdoc">返回操作错误代码</div><div class="ttdef"><b>定义</b> <a href="#l00228">tcpbase.hpp:228</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_a9fa40f908f40bc2fc0638ebce51cd220"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#a9fa40f908f40bc2fc0638ebce51cd220">CUVClient::Send</a></div><div class="ttdeci">err_code Send(const char *data, size_t s)</div><div class="ttdoc">发送数据。这个函数发送的时候不会将要发送的数据拷贝到缓冲区中 因此需要在具体应用的时候进行数据内存管理。</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00394">uv_tcp_c.cpp:394</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_aa31faff813bc6892717e4a6397f518d9"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#aa31faff813bc6892717e4a6397f518d9">CUVClient::Error</a></div><div class="ttdeci">void Error(int e)</div><div class="ttdoc">获取操作错误字符串描述</div><div class="ttdef"><b>定义</b> <a href="#l00236">tcpbase.hpp:236</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_aa775314ab893e731e2dbb56cfdc605b9"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#aa775314ab893e731e2dbb56cfdc605b9">CUVClient::CUVClient</a></div><div class="ttdeci">CUVClient(const std::string &amp;url, int port)</div><div class="ttdoc">构造客户端对象</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00115">uv_tcp_c.cpp:115</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_aa8f31023e50ff317e9746c4af2442b5c"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#aa8f31023e50ff317e9746c4af2442b5c">CUVClient::is_run</a></div><div class="ttdeci">std::atomic&lt; bool &gt; is_run</div><div class="ttdef"><b>定义</b> <a href="#l00078">tcpbase.hpp:78</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_aaac4ecbd575496ad48ba3953cfe422c7"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#aaac4ecbd575496ad48ba3953cfe422c7">CUVClient::cb_send</a></div><div class="ttdeci">std::function&lt; void(size_t)&gt; cb_send</div><div class="ttdef"><b>定义</b> <a href="#l00081">tcpbase.hpp:81</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_aabfa4218e748e659129616623b14a46d"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#aabfa4218e748e659129616623b14a46d">CUVClient::cb_conn</a></div><div class="ttdeci">std::function&lt; void()&gt; cb_conn</div><div class="ttdef"><b>定义</b> <a href="#l00083">tcpbase.hpp:83</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_aade49f6b18bb580dacd6945ac074a16d"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#aade49f6b18bb580dacd6945ac074a16d">CUVClient::cb_resolv</a></div><div class="ttdeci">std::function&lt; void(const struct addrinfo *cb)&gt; cb_resolv</div><div class="ttdef"><b>定义</b> <a href="#l00084">tcpbase.hpp:84</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_abafcf34dfd18e780b6d9ae69347993d7"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#abafcf34dfd18e780b6d9ae69347993d7">CUVClient::OnRecv</a></div><div class="ttdeci">virtual void OnRecv(const char *, size_t, err_code)</div><div class="ttdoc">接收到数据后，调用这个函数</div><div class="ttdef"><b>定义</b> <a href="#l00186">tcpbase.hpp:186</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_abb0bccfc4b75000932f6f02f35a7e8fe"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#abb0bccfc4b75000932f6f02f35a7e8fe">CUVClient::on_close</a></div><div class="ttdeci">void on_close(std::function&lt; void()&gt; f)</div><div class="ttdoc">设置关闭回调函数</div><div class="ttdef"><b>定义</b> <a href="#l00285">tcpbase.hpp:285</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_abf27a8321a7a8b94267cdbb08e8c8f5d"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#abf27a8321a7a8b94267cdbb08e8c8f5d">CUVClient::on_send</a></div><div class="ttdeci">void on_send(std::function&lt; void(size_t)&gt; f)</div><div class="ttdoc">设置发送完成回调函数</div><div class="ttdef"><b>定义</b> <a href="#l00312">tcpbase.hpp:312</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ac22db94140177279708314568830256e"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ac22db94140177279708314568830256e">CUVClient::cb_recv</a></div><div class="ttdeci">std::function&lt; void(size_t, const char *)&gt; cb_recv</div><div class="ttdef"><b>定义</b> <a href="#l00080">tcpbase.hpp:80</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58">CUVClient::err_code</a></div><div class="ttdeci">err_code</div><div class="ttdef"><b>定义</b> <a href="#l00026">tcpbase.hpp:26</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a0b461e4c214c215937c371a01dbbbfca"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a0b461e4c214c215937c371a01dbbbfca">CUVClient::ERR_UVCLIENT_INIT_TCP</a></div><div class="ttdeci">@ ERR_UVCLIENT_INIT_TCP</div><div class="ttdef"><b>定义</b> <a href="#l00030">tcpbase.hpp:30</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a1337d5e97c2217e467a29453df059d90"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a1337d5e97c2217e467a29453df059d90">CUVClient::ERR_SEND_DATA_EMPTY</a></div><div class="ttdeci">@ ERR_SEND_DATA_EMPTY</div><div class="ttdef"><b>定义</b> <a href="#l00041">tcpbase.hpp:41</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a13f2b6bc173e934bfb3039bb3454dba3"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a13f2b6bc173e934bfb3039bb3454dba3">CUVClient::ERR_CONN_OVERTIME</a></div><div class="ttdeci">@ ERR_CONN_OVERTIME</div><div class="ttdef"><b>定义</b> <a href="#l00040">tcpbase.hpp:40</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a147327933a6559522b3d469d74212d87"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a147327933a6559522b3d469d74212d87">CUVClient::OK</a></div><div class="ttdeci">@ OK</div><div class="ttdef"><b>定义</b> <a href="#l00044">tcpbase.hpp:43</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a39ecc66b86ca7356cb023868919b086b"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a39ecc66b86ca7356cb023868919b086b">CUVClient::ERR_DATA_NULL</a></div><div class="ttdeci">@ ERR_DATA_NULL</div><div class="ttdef"><b>定义</b> <a href="#l00042">tcpbase.hpp:42</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a4e5c95eaec1e996494fc22087b14978a"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a4e5c95eaec1e996494fc22087b14978a">CUVClient::ERR_UVCLIENT_LOOP_INIT</a></div><div class="ttdeci">@ ERR_UVCLIENT_LOOP_INIT</div><div class="ttdef"><b>定义</b> <a href="#l00029">tcpbase.hpp:29</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a503b1dc10bfb0898c95cb23bc936f116"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a503b1dc10bfb0898c95cb23bc936f116">CUVClient::ERR_UVCLIENT_DNS</a></div><div class="ttdeci">@ ERR_UVCLIENT_DNS</div><div class="ttdef"><b>定义</b> <a href="#l00038">tcpbase.hpp:38</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a52c863e5726058cfb624aacb54a42762"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a52c863e5726058cfb624aacb54a42762">CUVClient::ERR_UVCLIENT_SEND</a></div><div class="ttdeci">@ ERR_UVCLIENT_SEND</div><div class="ttdef"><b>定义</b> <a href="#l00037">tcpbase.hpp:37</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a66b0863905fd767a2e2b42030c18bec4"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a66b0863905fd767a2e2b42030c18bec4">CUVClient::ERR_UVCLIENT_CONNECTION</a></div><div class="ttdeci">@ ERR_UVCLIENT_CONNECTION</div><div class="ttdef"><b>定义</b> <a href="#l00033">tcpbase.hpp:33</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a6bf07154c0b4ba6a5849a835738dd896"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a6bf07154c0b4ba6a5849a835738dd896">CUVClient::UV_CLIENT_CREATE_THD</a></div><div class="ttdeci">@ UV_CLIENT_CREATE_THD</div><div class="ttdef"><b>定义</b> <a href="#l00039">tcpbase.hpp:39</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a6d5ea39f90cf0cbd5ae24108811c7f0c"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a6d5ea39f90cf0cbd5ae24108811c7f0c">CUVClient::ERR_ALLOC_MEM</a></div><div class="ttdeci">@ ERR_ALLOC_MEM</div><div class="ttdef"><b>定义</b> <a href="#l00035">tcpbase.hpp:35</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58a9c10b23ae91200ca36f1c55d783964e0"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58a9c10b23ae91200ca36f1c55d783964e0">CUVClient::ERR_UVCLIENT_ALOCMEM</a></div><div class="ttdeci">@ ERR_UVCLIENT_ALOCMEM</div><div class="ttdef"><b>定义</b> <a href="#l00032">tcpbase.hpp:32</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58aa21929f4e89447ed2568f55661fe80bc"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58aa21929f4e89447ed2568f55661fe80bc">CUVClient::ERR_UVCLIENT_RECV</a></div><div class="ttdeci">@ ERR_UVCLIENT_RECV</div><div class="ttdef"><b>定义</b> <a href="#l00036">tcpbase.hpp:36</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58aab6af6e1ea09e5e79f7448e05f105d80"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58aab6af6e1ea09e5e79f7448e05f105d80">CUVClient::ERR_UV_DNS_RESOLVE</a></div><div class="ttdeci">@ ERR_UV_DNS_RESOLVE</div><div class="ttdef"><b>定义</b> <a href="#l00034">tcpbase.hpp:34</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58aae261adeeb1d5836a7321560f1766f85"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58aae261adeeb1d5836a7321560f1766f85">CUVClient::ERR_UVCLIENT_LOOP_CONFIG</a></div><div class="ttdeci">@ ERR_UVCLIENT_LOOP_CONFIG</div><div class="ttdef"><b>定义</b> <a href="#l00028">tcpbase.hpp:28</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58abc96c2538ddf34e03726ff069564d8d0"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58abc96c2538ddf34e03726ff069564d8d0">CUVClient::ERR_UVCLIENT_OPERATION</a></div><div class="ttdeci">@ ERR_UVCLIENT_OPERATION</div><div class="ttdef"><b>定义</b> <a href="#l00031">tcpbase.hpp:31</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad5bec78d0e2def9dc9ba3922a1882e58ae3c9bbdab909aa76e8083f25588d4144"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad5bec78d0e2def9dc9ba3922a1882e58ae3c9bbdab909aa76e8083f25588d4144">CUVClient::ERR_UVCLIENT_INIT_MUTEX</a></div><div class="ttdeci">@ ERR_UVCLIENT_INIT_MUTEX</div><div class="ttdef"><b>定义</b> <a href="#l00027">tcpbase.hpp:27</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ad88a2b7043d30c8cc6bd6541a9bae8f4"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ad88a2b7043d30c8cc6bd6541a9bae8f4">CUVClient::onShutdown</a></div><div class="ttdeci">void onShutdown()</div><div class="ttdoc">处理shutdown事件</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00139">uv_tcp_c.cpp:139</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_ae74d74bc2a71385ecf47b7c0cb783610"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#ae74d74bc2a71385ecf47b7c0cb783610">CUVClient::req</a></div><div class="ttdeci">uv_connect_t req</div><div class="ttdef"><b>定义</b> <a href="#l00068">tcpbase.hpp:68</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_aeb8e88fe696e6bf387c52db105e5718c"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#aeb8e88fe696e6bf387c52db105e5718c">CUVClient::cb_close</a></div><div class="ttdeci">std::function&lt; void()&gt; cb_close</div><div class="ttdef"><b>定义</b> <a href="#l00082">tcpbase.hpp:82</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_aebd24a8632f21e89f7bdb2946c5c1d3e"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#aebd24a8632f21e89f7bdb2946c5c1d3e">CUVClient::Close</a></div><div class="ttdeci">void Close()</div><div class="ttdoc">断开连接</div><div class="ttdef"><b>定义</b> <a href="../../d6/d9a/uv__tcp__c_8cpp_source.html#l00205">uv_tcp_c.cpp:205</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_aecd5a533b5960854bb67535986b24e8c"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#aecd5a533b5960854bb67535986b24e8c">CUVClient::port</a></div><div class="ttdeci">void port(int port)</div><div class="ttdoc">指定服务器端口</div><div class="ttdef"><b>定义</b> <a href="#l00224">tcpbase.hpp:224</a></div></div>
<div class="ttc" id="aclass_c_u_v_client_html_af76e08cee2ed876b1274a1dd04817da6"><div class="ttname"><a href="../../db/d6e/class_c_u_v_client.html#af76e08cee2ed876b1274a1dd04817da6">CUVClient::Client</a></div><div class="ttdeci">uv_tcp_t * Client()</div><div class="ttdoc">获取客户端指针</div><div class="ttdef"><b>定义</b> <a href="#l00194">tcpbase.hpp:194</a></div></div>
<div class="ttc" id="aclasswheels_1_1_c_timer_html"><div class="ttname"><a href="../../db/d3e/classwheels_1_1_c_timer.html">wheels::CTimer</a></div><div class="ttdef"><b>定义</b> <a href="../../df/d05/timer_8hpp_source.html#l00026">timer.hpp:27</a></div></div>
<div class="ttc" id="amisc_8hpp_html"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html">misc.hpp</a></div></div>
<div class="ttc" id="astruct_c_u_v_client_1_1st__connreq_html"><div class="ttname"><a href="../../dc/dba/struct_c_u_v_client_1_1st__connreq.html">CUVClient::st_connreq</a></div><div class="ttdef"><b>定义</b> <a href="#l00062">tcpbase.hpp:62</a></div></div>
<div class="ttc" id="astruct_c_u_v_client_1_1st__connreq_html_a09676d49bdc1ccb713830c70704e3af5"><div class="ttname"><a href="../../dc/dba/struct_c_u_v_client_1_1st__connreq.html#a09676d49bdc1ccb713830c70704e3af5">CUVClient::st_connreq::st_connreq</a></div><div class="ttdeci">st_connreq()</div><div class="ttdef"><b>定义</b> <a href="#l00065">tcpbase.hpp:65</a></div></div>
<div class="ttc" id="astruct_c_u_v_client_1_1st__connreq_html_a29f4498a2ff0ecc6048259bcfbbcdcb2"><div class="ttname"><a href="../../dc/dba/struct_c_u_v_client_1_1st__connreq.html#a29f4498a2ff0ecc6048259bcfbbcdcb2">CUVClient::st_connreq::obj</a></div><div class="ttdeci">CUVClient * obj</div><div class="ttdef"><b>定义</b> <a href="#l00063">tcpbase.hpp:63</a></div></div>
<div class="ttc" id="astruct_c_u_v_client_1_1st__wd_html"><div class="ttname"><a href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html">CUVClient::st_wd</a></div><div class="ttdef"><b>定义</b> <a href="#l00052">tcpbase.hpp:52</a></div></div>
<div class="ttc" id="astruct_c_u_v_client_1_1st__wd_html_a60d408729eb32b45c3d5f2c2a15d1d5a"><div class="ttname"><a href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#a60d408729eb32b45c3d5f2c2a15d1d5a">CUVClient::st_wd::__this</a></div><div class="ttdeci">void * __this</div><div class="ttdef"><b>定义</b> <a href="#l00054">tcpbase.hpp:54</a></div></div>
<div class="ttc" id="astruct_c_u_v_client_1_1st__wd_html_a7a5e67a6be418374f942ffb79f405d14"><div class="ttname"><a href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#a7a5e67a6be418374f942ffb79f405d14">CUVClient::st_wd::st_wd</a></div><div class="ttdeci">st_wd()</div><div class="ttdef"><b>定义</b> <a href="#l00057">tcpbase.hpp:57</a></div></div>
<div class="ttc" id="astruct_c_u_v_client_1_1st__wd_html_ad74930fea69b2edc0e8c0ada48a4916f"><div class="ttname"><a href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#ad74930fea69b2edc0e8c0ada48a4916f">CUVClient::st_wd::__ds</a></div><div class="ttdeci">size_t __ds</div><div class="ttdef"><b>定义</b> <a href="#l00055">tcpbase.hpp:55</a></div></div>
<div class="ttc" id="astruct_c_u_v_client_1_1st__wd_html_ade7900bf50dee295500572345477f46c"><div class="ttname"><a href="../../d4/d9a/struct_c_u_v_client_1_1st__wd.html#ade7900bf50dee295500572345477f46c">CUVClient::st_wd::__buff</a></div><div class="ttdeci">void * __buff</div><div class="ttdef"><b>定义</b> <a href="#l00053">tcpbase.hpp:53</a></div></div>
<div class="ttc" id="atimer_8hpp_html"><div class="ttname"><a href="../../df/d05/timer_8hpp.html">timer.hpp</a></div></div>
<div class="ttc" id="auvlper_8hpp_html"><div class="ttname"><a href="../../dc/d4b/uvlper_8hpp.html">uvlper.hpp</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
